<template>
  <view>

    <view class="template-about tn-safe-area-inset-bottom">


      <view class="top-backgroup">
        <image src='https://resource.tuniaokj.com/images/swiper/summer.jpg' mode='widthFix'
               class='backgroud-image'></image>
      </view>

      <view class="tnwave waveAnimation">
        <view class="waveWrapperInner bgTop">
          <view class="wave waveTop"
                style="background-image: url('https://resource.tuniaokj.com/images/wave/wave-2.png')"></view>
        </view>
        <view class="waveWrapperInner bgMiddle">
          <view class="wave waveMiddle"
                style="background-image: url('https://resource.tuniaokj.com/images/wave/wave-2.png')"></view>
        </view>
        <view class="waveWrapperInner bgBottom">
          <view class="wave waveBottom"
                style="background-image: url('https://resource.tuniaokj.com/images/wave/wave-1.png')"></view>
        </view>
      </view>

      <view class="about__wrap">
        <!-- 头像用户信息 -->
        <view class="user-info__container tn-flex tn-flex-direction-column tn-flex-col-center tn-flex-row-center">
          <view class="user-info__avatar tn-bg-grey--light tn-flex tn-flex-col-center tn-flex-row-center">
            <view class="tn-shadow-blur">
              <tn-avatar :src="userInfo.avatar"  size="xl"/>
            </view>
            <!-- <view class="tn-icon-logo-tuniao" style="font-size: 140rpx;color: #01BEFF;"></view> -->
          </view>
          <view class="user-info__nick-name">{{ userInfo.nickname }}</view>
        </view>


        <!-- 更多信息-->
        <view
            class="about-shadow tn-margin-top-xl tn-padding-top-sm tn-padding-bottom-sm tn-margin-left tn-margin-right"
            style="margin-top: 170rpx">
          <tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30">
            <view class="tn-flex tn-flex-col-center">
              <view
                  class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-16 tn-color-white">
                <view class="tn-icon-wechat-fill"></view>
              </view>
              <view class="tn-margin-left-sm tn-flex-1" @click="goToUserInfoDetail">用户信息</view>
              <view class="tn-margin-left-sm tn-color-cyan tn-icon-link"></view>
            </view>
          </tn-list-cell>
          <tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30">
            <view class="tn-flex tn-flex-col-center" @click="getUserInfoToCopy">
              <view
                  class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-8 tn-color-white">
                <view class="tn-icon-message-fill"></view>
              </view>
              <view class="tn-margin-left-sm tn-flex-1">联系我们</view>
              <view class="tn-margin-left-sm tn-color-blue tn-icon-copy-fill"></view>
            </view>
          </tn-list-cell>

          <tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="logout">
            <view class="tn-flex tn-flex-col-center">
              <view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-12 tn-color-white">
                <view class="tn-icon-safe-fill"></view>
              </view>
              <view class="tn-margin-left-sm tn-flex-1">退出登录</view>
              <view class="tn-margin-left-sm tn-color-red tn-icon-fire-fill"></view>
            </view>
          </tn-list-cell>

        </view>

      </view>

    </view>


    <view class="tabbar footerfixed">
      <view class="action navbar__item -blue" @click="switchToHome">
        <view class="bar-icon">
          <view class="tn-icon-home-capsule navbar__icon">
          </view>
        </view>
        <view class="-blue bar-text">
          <text style="margin-bottom:-100rpx;font-size:20rpx;color:#303030;">首页</text>
        </view>
      </view>
      <view class="action navbar__item -orange" @click="switchToGroup">
        <view class="bar-icon">
          <view class="tn-icon-honor navbar__icon">
          </view>
        </view>
        <view class="-orange bar-text">
          <text style="margin-bottom:-100rpx;font-size:20rpx;color:#303030;">分组</text>
        </view>
      </view>
      <view class="action navbar__item -yellow" @click="switchToMemo">
        <view class="bar-icon">
          <view class="tn-icon-discover-planet navbar__icon">
          </view>
        </view>
        <view class="-yellow bar-text">
          <text style="margin-bottom:-100rpx;font-size:20rpx;color:#303030;">备忘</text>
        </view>
      </view>
      <view class="action navbar__item -purple" @click="switchToMy">
        <view class="bar-icon">
          <view class="tn-icon-my navbar__icon">
            <!-- <tn-badge :absolute="true">99+</tn-badge> -->
          </view>
        </view>
        <view class="-purple bar-text">
          <text style="margin-bottom:-100rpx;font-size:20rpx;color:#303030;">我的</text>
        </view>
      </view>
    </view>
    <view class="tn-padding-xl"></view>

  </view>
</template>

<script>
import {getUserInfo} from "@/api/user";

export default {
  data() {
    return {
      userInfo: {}

    };

  },
  onLoad() {
    // #ifndef MP-WEIXIN
    uni.hideTabBar()
    // #endif
  },

  onShow() {
    getUserInfo().then(res => {
      console.log('用户信息', res)
      this.userInfo = res.data
    })
  },

  methods: {
    logout() {
      uni.showModal({
        title: '提示',
        content: '确定退出登录吗？',
        success: function (res) {
          if (res.confirm) {
            console.log('用户点击确定');
            uni.removeStorageSync('tokenValue')
            uni.reLaunch({
              url: '/pages/login/login'
            })
          } else if (res.cancel) {
            console.log('用户点击取消');
          }
        }
      });
    },
    goToUserInfoDetail() {
      console.log('用户信息')
      uni.navigateTo({
        url: '/pages/userInfoDetail/userInfoDetail'
      })
    },
    getUserInfoToCopy() {
      console.log('联系我们')
      uni.setClipboardData({
        data: '微信号：mr13317225678',
        success: function () {
          uni.showToast({
            title: '微信号已复制',
            icon: 'none'
          });
        }
      });

    },


    switchToGroup() {
      console.log('切换到分组')
      uni.switchTab({
        url: '/pages/group/group'
      })
    },
    switchToHome() {
      console.log('切换到首页')
      uni.switchTab({
        url: '/pages/index/index'
      })
    },
    switchToMemo() {
      console.log('切换到备忘')
      uni.switchTab({
        url: '/pages/alarm/alarm'
      })
    },
    switchToMy() {
      console.log('切换到我的')
      uni.switchTab({
        url: '/pages/userInfo/userInfo'
      })
    },

  },
}
</script>


<style lang="scss" scoped>
@import '@/static/css/templatePage/custom_nav_bar.scss';

.template-about {
}

/* 顶部背景图 start */
.top-backgroup {
  height: 450rpx;
  z-index: -1;

  .backgroud-image {
    width: 100%;
    height: 450rpx;
    // z-index: -1;
  }
}

/* 顶部背景图 end */

/* 波浪*/
@keyframes move_wave {
  0% {
    transform: translateX(0) translateZ(0) scaleY(1)
  }
  50% {
    transform: translateX(-25%) translateZ(0) scaleY(1)
  }
  100% {
    transform: translateX(-50%) translateZ(0) scaleY(1)
  }
}

.tnwave {
  overflow: hidden;
  position: absolute;
  z-index: 9999;
  height: 200rpx;
  left: 0;
  right: 0;
  top: 290rpx;
  bottom: auto;
}

.waveWrapperInner {
  position: absolute;
  width: 100%;
  overflow: hidden;
  height: 100%;
}

.wave {
  position: absolute;
  left: 0;
  width: 200%;
  height: 100%;
  background-repeat: repeat no-repeat;
  background-position: 0 bottom;
  transform-origin: center bottom;
}

.bgTop {
  opacity: 0.4;
}

.waveTop {
  background-size: 50% 45px;
}

.waveAnimation .waveTop {
  animation: move_wave 4s linear infinite;
}

.bgMiddle {
  opacity: 0.6;
}

.waveMiddle {
  background-size: 50% 40px;
}

.waveAnimation .waveMiddle {
  animation: move_wave 3.5s linear infinite;
}

.bgBottom {
  opacity: 0.95;
}

.waveBottom {
  background-size: 50% 35px;
}

.waveAnimation .waveBottom {
  animation: move_wave 2s linear infinite;
}

/* 波浪*/

/* 页面 start*/
.about-shadow {
  border-radius: 15rpx;
  box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
}

.about {

  &__wrap {
    position: relative;
    z-index: 1;
    // margin: 20rpx 30rpx;
    margin-top: -330rpx;
  }
}

/* 页面 end*/

/* 用户信息 start */
.user-info {
  &__container {

  }

  &__avatar {
    width: 170rpx;
    height: 170rpx;
    border: 8rpx solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
  }

  &__nick-name {
    margin-top: 26rpx;
    font-size: 36rpx;
    font-weight: 600;
    text-align: center;
  }
}

/* 用户信息 end */
/* 图标容器1 start */
.icon1 {
  &__item {
    // width: 30%;
    background-color: #FFFFFF;
    border-radius: 10rpx;
    padding: 30rpx;
    margin: 20rpx 10rpx;
    transform: scale(1);
    transition: transform 0.3s linear;
    transform-origin: center center;

    &--icon {
      width: 40rpx;
      height: 40rpx;
      font-size: 28rpx;
      border-radius: 50%;
      position: relative;
      z-index: 1;

      &::after {
        content: " ";
        position: absolute;
        z-index: -1;
        width: 100%;
        height: 100%;
        left: 0;
        bottom: 0;
        border-radius: inherit;
        opacity: 1;
        transform: scale(1, 1);
        background-size: 100% 100%;
        background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg.png);
      }
    }
  }
}

/* 图标容器1 end */

/* 底部tabbar start*/
.footerfixed {
  position: fixed;
  width: 100%;
  bottom: 0;
  z-index: 999;
  background-color: #FFFFFF;
  box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
}

.tabbar {
  display: flex;
  align-items: center;
  min-height: 110rpx;
  justify-content: space-between;
  padding: 0;
  height: calc(110rpx + env(safe-area-inset-bottom) / 2);
  padding-bottom: calc(env(safe-area-inset-bottom) / 2);
}

.tabbar .action {
  font-size: 22rpx;
  position: relative;
  flex: 1;
  text-align: center;
  padding: 0;
  display: block;
  height: auto;
  line-height: 1;
  margin: 0;
  overflow: initial;
}

.tabbar .action .bar-icon {
  width: 100rpx;
  position: relative;
  display: block;
  height: auto;
  margin: 0 auto 10rpx;
  text-align: center;
  font-size: 42rpx;
}

.tabbar .action .bar-icon image {
  width: 50rpx;
  height: 50rpx;
  display: inline-block;
}
</style>

<style lang="scss" scoped>
@import '@/static/css/templatePage/custom_nav_bar.scss';

.template-music {
}


.add-grain {
  position: fixed;

  bottom: 200rpx;
  right: 50rpx;
  font-size: 80rpx;

  z-index: 999;

}

/* 自定义导航栏内容 start */
.custom-nav {
  height: 100%;

  &__back {
    margin: auto 5rpx;
    font-size: 40rpx;
    margin-right: 10rpx;
    margin-left: 30rpx;
    flex-basis: 5%;
  }

  &__search {
    flex-basis: 60%;
    width: 100%;
    height: 100%;

    &__box {
      width: 100%;
      height: 70%;
      padding: 10rpx 0;
      margin: 0 30rpx;
      border-radius: 60rpx 60rpx 0 60rpx;
      font-size: 24rpx;
      background-color: rgba(255, 255, 255, 0.2);
    }

    &__icon {
      padding-right: 10rpx;
      margin-left: 20rpx;
      font-size: 30rpx;
    }

    &__text {
    }
  }
}

/* 自定义导航栏内容 end */

/* 图标容器12 start */
.tn-three {
  position: absolute;
  top: 50%;
  right: 50%;
  bottom: 50%;
  left: 50%;
  transform: translate(-38rpx, -16rpx) rotateX(30deg) rotateY(20deg) rotateZ(-30deg);
  text-shadow: -1rpx 2rpx 0 #f0f0f0, -2rpx 4rpx 0 #f0f0f0, -10rpx 20rpx 30rpx rgba(0, 0, 0, 0.2);
}

.icon12 {
  &__item {
    width: 30%;
    background-color: #FFFFFF;
    border-radius: 10rpx;
    padding: 30rpx;
    margin: 20rpx 10rpx;
    transform: scale(1);
    transition: transform 0.3s linear;
    transform-origin: center center;

    &--icon {
      width: 100rpx;
      height: 100rpx;
      font-size: 60rpx;
      border-radius: 50%;
      margin-bottom: 18rpx;
      position: relative;
      z-index: 1;

      &::after {
        content: " ";
        position: absolute;
        z-index: -1;
        width: 100%;
        height: 100%;
        left: 0;
        bottom: 0;
        border-radius: inherit;
        opacity: 1;
        transform: scale(1, 1);
        background-size: 100% 100%;
        background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg.png);


      }
    }
  }
}

/* 文章内容 start*/
.tn-blogger-content {
  &__wrap {
    box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.12);
    border-radius: 20rpx;
    margin: 15rpx;
  }

  &__info {
    &__btn {
      margin-right: -12rpx;
      opacity: 0.5;
    }
  }

  &__label {
    &__item {
      line-height: 45rpx;
      padding: 0 20rpx;
      margin: 5rpx 18rpx 0 0;

      &--prefix {
        color: #82B2FF;
        padding-right: 10rpx;
      }
    }

    &__desc {
      line-height: 35rpx;
    }
  }

  &__main-image {
    border-radius: 16rpx 16rpx 0 0;

    &--1 {
      max-width: 690rpx;
      min-width: 690rpx;
      max-height: 400rpx;
      min-height: 400rpx;
    }

    &--2 {
      max-width: 260rpx;
      max-height: 260rpx;
    }

    &--3 {
      height: 212rpx;
      width: 100%;
    }
  }

  &__count-icon {
    font-size: 30rpx;
    padding-right: 5rpx;
  }
}

.image-music {
  padding: 150rpx 0rpx;
  font-size: 16rpx;
  font-weight: 300;
  position: relative;
}

.image-pic {
  background-size: cover;
  background-repeat: no-repeat;
  // background-attachment:fixed;
  background-position: top;
  border-radius: 20rpx 20rpx 0 0;
}

/* 文章内容 end*/

/* 底部tabbar start*/
.footerfixed {
  position: fixed;
  width: 100%;
  bottom: 0;
  z-index: 999;
  background-color: #FFFFFF;
  box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
}

.tabbar {
  display: flex;
  align-items: center;
  min-height: 110rpx;
  justify-content: space-between;
  padding: 0;
  height: calc(110rpx + env(safe-area-inset-bottom) / 2);
  padding-bottom: calc(env(safe-area-inset-bottom) / 2);
}

.tabbar .action {
  font-size: 22rpx;
  position: relative;
  flex: 1;
  text-align: center;
  padding: 0;
  display: block;
  height: auto;
  line-height: 1;
  margin: 0;
  overflow: initial;
}

.tabbar .action .bar-icon {
  width: 100rpx;
  position: relative;
  display: block;
  height: auto;
  margin: 0 auto 10rpx;
  text-align: center;
  font-size: 42rpx;
}

.tabbar .action .bar-icon image {
  width: 50rpx;
  height: 50rpx;
  display: inline-block;
}

/* 底部标签栏动画 */
.navbar__item .bar-text {
  font-variant: small-caps;
  margin: 0;
  padding: 0;
  display: inline-flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  position: relative;
  width: 50rpx;
  height: 50rpx;
  background-size: cover;
  background-position: center;
  vertical-align: middle;
  background-color: currentColor;
  border-radius: 50%;
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.55s cubic-bezier(0.71, 0.03, 0.23, 0.95);
}

.navbar__item.-blue {
  color: #06b8ff;
}

.navbar__item.-orange {
  color: #f2704d;
}

.navbar__item.-yellow {
  color: #f8cd4b;
}

.navbar__item.-purple {
  color: #8444d6;
}

.bar-text.-blue {
  color: #06b8ff;
}

.bar-text.-orange {
  color: #f2704d;
}

.bar-text.-yellow {
  color: #f8cd4b;
}

.bar-text.-purple {
  color: #8444d6;
}

.navbar__item:active .bar-text {
  transform: translateY(-74rpx) scale(1.4);
  opacity: 1;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1),
  -1px -1px 5px rgba(255, 255, 255, 1);
}

.navbar__item:active::before {
  opacity: 1;
}

.navbar__item:active::after {
  opacity: 0.4;
}

.navbar__item:active .navbar__icon {
  transform: translateY(-42rpx) scale(1);
  color: #fff;
  transition-delay: 0.1s, 0.1s;
}

.navbar__icon {
  bottom: -26rpx;
  transition: all 0.5s cubic-bezier(0.71, 0.03, 0.23, 0.95);
  transition-delay: 0.1s;
  display: inline-block;
  position: relative;
  z-index: 2;
}
</style>
